package arch.dao.impl.archive;

import java.sql.PreparedStatement;
import java.sql.SQLException;

import org.springframework.jdbc.core.BatchPreparedStatementSetter;
/**
 * 
 * @author zhangxue
 *
 */
public class ArchdefOperationsBatchPreparedStatementSetter implements
		BatchPreparedStatementSetter {
	private int archdefID;
	private int[] OperationIDs;
	
	

	public ArchdefOperationsBatchPreparedStatementSetter(int archdefID,
			int[] operationIDs) {
		super();
		this.archdefID = archdefID;
		OperationIDs = operationIDs;
	}

	public int getBatchSize() {
		
		return OperationIDs.length;
	}

	public void setValues(PreparedStatement ps, int i) throws SQLException {
		ps.setInt(1,archdefID);
		ps.setInt(2, OperationIDs[i]);
	}

}
